<template>
	<view class="">
		<view class="u-p-t-30">
			<u-cell-group>
				<u-cell-item title="实名认证" :title-style="{fontSize:'30rpx'}" index="1" @click="cellClick"
					:value="userInfo.is_real?'已认证':'未认证'"
					:value-style="{color:userInfo.is_real?$appConfig.mainColor:'#999999'}"></u-cell-item>
				<u-cell-item title="绑定微信" :title-style="{fontSize:'30rpx'}" index="2" @click="cellClick"></u-cell-item>
				<u-cell-item title="绑定手机" :title-style="{fontSize:'30rpx'}" index="3" @click="cellClick">
					<view class="" slot="right-icon">
						<text>{{userInfo.phone}}</text>
						<text class="u-type-primary u-m-l-20">更换手机号</text>
					</view>
				</u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {}
			}
		},
		onShow() {
			this.userInfo = this.$store.state.vuex_userInfo
		},
		methods: {
			cellClick(index) {
				switch (index) {
					case '1':
						this.shiming()
						break;
					case '2':
						this.wxBinding()
						break;
					case '3':
						this.mobelBinding()
						break;
				}
			},
			shiming() {
				if (this.userInfo.is_real) {
					this.$u.route('/pages/subpage/setting/sminfo')
				} else {
					this.$u.route('/pages/subpage/profile/autonym')
				}
			},
			wxBinding() {
				this.$u.toast('已绑定微信')
			},
			mobelBinding() {
				this.$u.route('/pages/subpage/setting/bindPhone')
			}
		}
	}
</script>

<style scoped lang="scss">
</style>